home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / diet145f.zip / DIETAPI.DOC < prev    next >
Text File  |  1992-04-30  |  10KB  |  233 lines

  1. ============================ DIETAPI.DOC ===============================
  2. ************************************************************************
  3.                DIET APPLICATION INTERFACE version 1.43e
  4.                copyright(c) 11/22/1991 by Teddy Matsumoto
  5. ************************************************************************
  6.  
  7.  **Application Interface of DIET.EXE**
  8.  
  9.  The following interrupts are designed to be used by application 
  10.  software authors to make easy controls over the status of DIET.EXE.
  11.  Ealier Versions of DIET.EXE used to check its TSR status from the 
  12.  key words in MCB with certain offsets. This method is no more available
  13.  since from this version on, DIET.EXE may stay as a program as well 
  14.  as a device driver. 
  15.  I tried to device a routine to control DIET.EXE using simple DOS calls. 
  16.  I present the details of the available service calls in the following
  17.  for those who writes shells and other applications for DIET.EXE.
  18.  DIET.EXE uses these interrupts to control its TSR part.
  19.  
  20.  **INTERRUPT of DOS used **
  21.  
  22.  INT 21h, AH=37h AL=D0h--DFh are used for the controls of TSR part of DIET.
  23.  Here is the original description of INT 21h AH=37h from the documents
  24.  'Interrupt List Release 90.4 compiled by Ralf Brown,ralf@cs.cmu.edu.
  25.  
  26. ---------------------------------------------
  27.  INT 21 - DOS 2+ internal - GET SWITCHAR
  28.     AX = 3700h
  29.  Return: AL = FFh unsupported subfunction
  30.     DL = current switch character
  31.  Notes:    documented in some OEM versions of some releases of DOS
  32.     supported by OS/2 compatibility box
  33.  SeeAlso: AX=3701h
  34.  ---------------------------------------------
  35.  INT 21 - DOS 2+ internal - SET SWITCHAR
  36.     AX = 3701h
  37.     DL = new switch character
  38.  Return: AL = FFh unsupported subfunction
  39.  Notes:    documented in some OEM versions of some releases of DOS
  40.     supported by OS/2 compatibility box
  41.  SeeAlso: AX=3700h
  42.  ---------------------------------------------
  43.  INT 21 - DOS 2.x and 4.0 only internal - AVAILDEV
  44.     AH = 37h
  45.     AL = subfunction
  46.        02h read device availability (as set by AL=03h)
  47.         Return: DL = device availability (always FFh under DOS 4.0)
  48.        03h set device availability, where:
  49.         DL = 00h means \DEV\ must preceed device names
  50.         DL <> 00h means \DEV\ need not preceed device names
  51.  Return: AL = FFh if invalid subfunction
  52.  Notes:    all versions of DOS from 2.00 allow \DEV\ to be prepended to device
  53.       names without generating an error even if the directory \DEV does
  54.       not actually exist (other paths generate an error if they do not
  55.       exist).
  56.     although DOS 4.0 accepts these calls, they have no effect
  57.  ---------------------------------------------
  58.  The description above makes me convince that there is no other TSR
  59.  program which makes use of this interrupt. I use this interrupt for
  60.  API to make easier controls over the functions of DIET,EXE.
  61.  To assure the safety further, I always set the BX register with ID
  62.  BX = 899Dh ('DI'+'ET').
  63.  
  64.  **Available Functions **
  65.     AX=37D0h        check TSR diet.exe
  66.     AX=37D1h        get segment where diet.exe stays resident
  67.     AX=37D2h        read TSR control flags.
  68.     AX=37D3h        set TSR control flags. 
  69.     AX=37D4h        read TSR options.
  70.     AX=37D5h        set TSR options.
  71.     AX=37D6h        read temporary directory names.
  72.     AX=37D7h        set temporary directory.
  73.     AX=37D8-37DBh   reseerved for future use by DIET.exe 
  74.     AX=37DCh        set address of external procedure.
  75.     AX=37DDh        release external procedure.
  76.     AX=37DEh        read EMS status.
  77.     AX=37DFh        remove TSR part from memory.
  78.  
  79.  
  80. ** HOW to USE API of DIET.EXE **
  81. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82.  These calls can be used only after establishing that the Resident Part of
  83.  DIET.EXE is in fact present, by making the call with AX=37D0h.
  84.  
  85.  ** Example.Disable TSR DIET.EXE temporarily for copying:
  86.  
  87.     AX=37D0h check if DIET.EXE is present as TSR program.
  88.     AX=37D2h read TSR control flags and preserve on stacks.
  89.     AX=37D3h disable TSR function of DIET.EXE 
  90.     Copy files if necessary 
  91.     AX=37D3h reset TSR control flags to the original state.
  92.  
  93.  
  94.  ** DIET API specifications **
  95.     All of the values in the resiters are preserved except those in
  96.     Return values.
  97. -----------------------------------------------------------------------------
  98.  ** Get DIET status**
  99.   int 21h  AH = 37h  BX = 899Dh ('DI'+'ET')
  100.            AL = D0h
  101.   Return:  AX = 0  CX = 899Dh  DX = version ID 
  102.                 DIET.EXE is present as TSR program.
  103.            AL = -1
  104.                 DIET.EXE is not present as TSR.
  105.                 AL = -1 is a default return value of DOS 2+ to 4.0.
  106. -----------------------------------------------------------------------------
  107. **Read Segment Address of TSR DIET.EXE 
  108.   int 21h  AH = 37h  BX = 899Dh ('DI'+'ET')
  109.            AL = D1h
  110.   Return:  AX = 0
  111.            CX = code segment of TSR part of DIET.EXE.
  112.            DX = memory block segment of TSR DIET.EXE.
  113.            DX = 0 if device=DIET.EXE in config.sys.
  114. -----------------------------------------------------------------------------
  115. ** Read control flags of TSR DIET.EXE
  116.   int 21h  AH = 37h  BX=899Dh ('DI'+'ET')
  117.            AL = D2h
  118.   Return:  AX = 0
  119.            DL = 0 DIET.EXE is active
  120.                 else diable
  121.            DH = Skip flag. 
  122.     Note:  Skip flags takes non-zero value while TSR is active.
  123. -----------------------------------------------------------------------------
  124.  ** Set TSR control flags
  125.   INT 21h  AH = 37h  BX=899Dh ('DI'+'ET')
  126.            AL = D3h
  127.            DL = TSR control flag ; 
  128.               = 0    : active
  129.               = else : disable
  130.            DH = 0 :    Skipflag
  131.   Return:  AX=0
  132. ------------------------------------------------------------------------------
  133.  **Read TSR otpitons
  134.   int 21h  AH = 37h  BX = 899Dh ('DI'+'ET')
  135.            AL = D4h
  136.   Return:  AX = 0
  137.            DX = TSR options;
  138.                 bit 1: automated compression of DIETed file  option -p
  139.                 bit 2: automated compression of created file option -w
  140.                 bit 3: Supress DIET message                  option -m
  141.                 bit 4: Display Origianl File size            option -s
  142.                 bit 5-16: reserved
  143. -----------------------------------------------------------------------------
  144.  ** Set TSR options
  145.   INT 21h  AX = 37h  BX=899Dh ('DI'+'ET')
  146.            AL = D5h
  147.            DX = TSR otpions
  148.                 bit 1: automated compression of DIETed file  option -p
  149.                 bit 2: automated compression of created file option -w
  150.                 bit 3: Supress DIET message                  option -m
  151.                 bit 4: Display Origianl File size            option -s
  152.                 bit 5ü`16: must be 0, reserved
  153.   Return:  AX = 0
  154. -----------------------------------------------------------------------------
  155.  ** Read Temproary directory name.
  156.   INT 21h  AX = 37h  BX=899Dh ('DI'+'ET')
  157.            AL = D6h
  158.   Return:  AX = 0
  159.            DS:DX = Temporary directory name.
  160.     Note:  DS:DX   NULL indicates the current directory.
  161. -----------------------------------------------------------------------------
  162.  ** Set temporary directory.
  163.   int 21h  AH = 37h  BX = 899Dh ('DI'+'ET')
  164.            AL = D7h
  165.            DS:DX = Temporary Directory Name.
  166.   Return:  AX = 0
  167.     Note:  Set temporary directory. The PATH name must begin with the
  168.            DRIVE name and must end with '\', the length of the name
  169.            must be within 61 letters ending with 0. 'NULL' specification
  170.            set the default, CURRENT directory.
  171. ------------------------------------------------------------------------------
  172.  **Set address of an external procedure
  173.   INT 21h  AH = 37h  BX = 899Dh ('DI'+'ET')
  174.            AL = DCh 
  175.            DS:DX = Address of external procedure.
  176.   Return:  AX = 0
  177.     Note:  Set address of the external procedure.
  178.            Resident part calls external procedure at the beginning of
  179.            decompression and on exiting compression by failure. Informations
  180.            are stacked with pointers:
  181.  
  182.         SP+0,3      return address.
  183.         SP+4,5      class;upon start  : file handle of DIETed file.
  184.                           upon failure: -1 file creation error
  185.                                         -2 fail to create by shortage of space
  186.